for i in [1,2,3,4]:
    for j in [1,2,3,4]:
        if i!=j:
            for k in [1,2,3,4]:
                if j!=k and i!=k:
                    print("{}{}{}".format(i,j,k))